package agenda;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import java.util.*;
import org.jdom.*;
import org.jdom.input.*;

/**
 *
 * @author josue
 */
public class load {


    public load(String path){


            SAXBuilder builder=new SAXBuilder(false);
            try{
            Document doc=builder.build(path);
            Element raiz=doc.getRootElement();
           
            List contactos=raiz.getChildren("contacto");
            Iterator i=contactos.iterator();
            
           while(i.hasNext()) {
            Element e=(Element)i.next();
            Element nombre=e.getChild("nombre");
            System.out.println(nombre.getText());
            Element apellido=e.getChild("apellido");
            System.out.println(apellido.getText());
            Element pse=e.getChild("seudonimo");
            System.out.println(pse.getText());
            Element clas=e.getChild("clasificacion");
            System.out.println(clas.getText());
            Element tel=e.getChild("telefono");
            System.out.println(tel.getText());
            Element cel=e.getChild("celular");
            System.out.println(cel.getText());
            Element dir=e.getChild("direccion");
            System.out.println(dir.getText());
            Element email=e.getChild("email");
            System.out.println(email.getText());
           }

        
            }
    catch (Exception e){System.out.println(e);}

    }


      public static void main(String args[]){

          load cc=new load("contactos.xml");
       
    }


}
